//
//  SYLabelTableViewCell.m
//  TermOfSectionB
//
//  Created by dllo on 15/11/30.
//  Copyright © 2015年 韩震明. All rights reserved.
//

#import "SYLabelTableViewCell.h"

#define SWIDTH [UIScreen mainScreen].bounds.size.width / 375.0
#define SHEIGHT [UIScreen mainScreen].bounds.size.height / 667.0

@implementation SYLabelTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    
    self.contlabel = [[UILabel alloc] init];
    self.contlabel.backgroundColor = [UIColor whiteColor];
    self.contlabel.numberOfLines = 0;
    [self.contentView addSubview:self.contlabel];
    [self.contlabel sizeToFit];
    self.contlabel.font = [UIFont systemFontOfSize:16];

    
}
- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    
    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:16], NSFontAttributeName, nil];
    CGRect rect = [self.contlabel.text boundingRectWithSize:CGSizeMake(365, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    self.contlabel.frame = CGRectMake(5 * SWIDTH, 5 * SHEIGHT, (self.contentView.frame.size.width - 10) * SWIDTH, rect.size.height * SHEIGHT);
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
